package com.qixiaobao.nondirect.invoice.mapper;

import com.qixiaobao.nondirect.invoice.domain.dto.NonDirectInvoiceDTO;
import com.qixiaobao.nondirect.invoice.domain.vo.NonDirectBillVO;
import com.qixiaobao.nondirect.invoice.domain.vo.NonDirectWaitInvoiceChargeVO;
import com.qixiaobao.nondirect.invoice.domain.Bill;
import com.qixiaobao.system.domain.dto.ChargeDTO;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description 开票信息  数据层
 * @Author yangxm
 * @Date 2025/6/30 17:04
 */
@Mapper
public interface BillMapper {


    /**
     * @Description 保存 开票信息
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param bill
     * @return int
     */
    int insertBill(Bill bill);

    /**
     * @Description 查询开票中列表
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param nonDirectInvoiceDTO
     * @return java.util.List<com.qixiaobao.nondirect.invoice.domain.vo.NonDirectBillVO>
     */
    List<NonDirectBillVO> selectInvoicingList(NonDirectInvoiceDTO nonDirectInvoiceDTO);

    /**
     * @Description 查询开票中列表 - 开票金额
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param nonDirectInvoiceDTO
     * @return java.math.BigDecimal
     */
    BigDecimal selectInvoicingTotal(NonDirectInvoiceDTO nonDirectInvoiceDTO);

    /**
     * @Description 根据ID查询开票信息
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param billId
     * @return com.qixiaobao.nondirect.invoice.domain.Bill
     */
    Bill selectBillById(Long billId);

    /**
     * @Description 修改开票信息
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param bill
     * @return int
     */
    int updateBill(Bill bill);

    /**
     * @Description 修改开票信息中的开票月份和最大金额对应的发票日期
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param bill
     * @return int
     */
    int updateMaxInvoiceDate(Bill bill);

    /**
     * @Description 根据开票信息ID列表查询开票信息
     * @Author yangxm
     * @Date 2025/6/30 17:05
     * @param idList
     * @return java.util.List<com.qixiaobao.nondirect.invoice.domain.Bill>
     */
    List<Bill> selectBillListByIdList(List<Long> idList);

    /**
     * @Description 开票中、待审核、已开票 - 费用详情
     * @Author yangxm
     * @Date 2025/7/7 14:06
     * @param chargeDTO
     * @return java.util.List<com.qixiaobao.nondirect.invoice.domain.vo.NonDirectWaitInvoiceChargeVO>
     */
    List<NonDirectWaitInvoiceChargeVO> selectInvoiceChargeList(ChargeDTO chargeDTO);

    /**
     * @Description 待审核、已开票 - 列表
     * @Author yangxm
     * @Date 2025/7/7 14:36
     * @param nonDirectInvoiceDTO
     * @return java.util.List<com.qixiaobao.nondirect.invoice.domain.vo.NonDirectBillVO>
     */
    List<NonDirectBillVO> selectInvoiceList(NonDirectInvoiceDTO nonDirectInvoiceDTO);

    /**
     * @Description 查询需要下载的发票ID集合
     * @Author yangxm
     * @Date 2025/7/7 16:45
     * @param nonDirectInvoiceDTO
     * @return java.util.List<java.lang.Long>
     */
    List<Long> selectInvoiceFileIdList(NonDirectInvoiceDTO nonDirectInvoiceDTO);
}
